import service from "./service";

// 获取歌单详情
export function getPlaylistDetail(id, cookie) {
    return service({
        url: `/playlist/detail?id=${id}&cookie=${cookie}`,
        method: 'get'
    })
}

// 收藏歌单
export function getSubscribe(id, t, cookie) {
    return service({
        url: `/playlist/subscribe?id=${id}&t=${t}&cookie=${cookie}`,
        method: 'get'
    })
}

// 获取歌单评论
export function getCommentPlaylist(id, limit) {
    return service({
        url: `/comment/playlist?id=${id}&limit=${limit}`,
        method: 'get'
    })
}

// 获取歌曲详情
export function getSongDetail(ids, cookie) {
    return service({
        url: `/song/detail?ids=${ids}&cookie=${cookie}`,
        method: 'get'
    })
}

// 音乐是否可用
export function checkMusic(id, cookie) {
    return service({
        url: `/check/music?id=${id}&cookie=${cookie}`,
    })
}

// 获取音乐 url
export function getSongUrl(id, cookie) {
    return service({
        url: `/song/url?id=${id}&cookie=${cookie}`,
        method: 'get'
    })
}

// 获取歌词
export function getLyric(id) {
    return service({
        url: `/lyric?id=${id}`,
        method: 'get'
    })
}

// 热门评论
export function getCommentHot(id, limit, type) {
    return service({
        url: `/comment/hot?id=${id}&limit=${limit}&type=${type}`,
        method: 'get',
    })
}

// 歌曲评论
export function getCommentMusic(id, limit, type) {
    return service({
        url: `/comment/music?id=${id}&limit=${limit}&type=${type}`,
        method: 'get',
    })
}

// 楼层评论
export function getCommentFloor(parentCommentId, id, limit, type) {
    return service({
        url: `/comment/floor?parentCommentId=${parentCommentId}&id=${id}&limit=${limit}&type=${type}`,
        method: 'get'
    })
}

// 每日推荐歌单
export function getRecommendResource() {
    return service({
        url: `/playlist/hot`,
        method: 'get'
    })
}

// 获取歌单列表
export function getTopPlaylist(params) {
    return service({
        url: `/top/playlist`,
        method: 'get',
        params
    })
}